package com.appleyk.relation;


import com.appleyk.node.Tuser;
import org.neo4j.ogm.annotation.EndNode;
import org.neo4j.ogm.annotation.GraphId;
import org.neo4j.ogm.annotation.RelationshipEntity;
import org.neo4j.ogm.annotation.StartNode;

import java.io.Serializable;

/**
 * 节点关系 Recomm   对象有前期 和 后继
 */
@RelationshipEntity(type = "Recomm")
public class Recomm implements Serializable {

    private static final long serialVersionUID = 5258162710421427749L;
    @GraphId
    private Long id;

    /**
     * 定义关系的起始节点 == StartNode
     * 父类类型中节点 ID 和节点名字 多用查询的条件
     * 前驱
     */

    @StartNode
    private Tuser startNode;

    /**
     * 定义关系的终止节点 == EndNode  所谓后继
     */

    @EndNode
    private Tuser endNode;

    public Recomm() {
    }

    /**
     * 初始化 构造方法
     * @param
     * @param startNode
     * @param endNode
     */
    public Recomm(Tuser startNode, Tuser endNode) {

        this.startNode = startNode;
        this.endNode = endNode;
    }

    public Long getId() {
        return id;
    }

    public Recomm setId(Long id) {
        this.id = id;
        return this;
    }

    public Tuser getStartNode() {
        return startNode;
    }

    public Recomm setStartNode(Tuser startNode) {
        this.startNode = startNode;
        return this;
    }

    public Tuser getEndNode() {
        return endNode;
    }

    public Recomm setEndNode(Tuser endNode) {
        this.endNode = endNode;
        return this;
    }
}
